<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- reorganize this, put it at beginner, intermediate and advanced. then let users determine the other data with the expert control. -->
<!-- How to get a success experience out of this? allow dragging of links and text files? allow the user to embed links? that's a good question. I'm not entirely satisfied with the way that web applications work. -->
<!-- put all of this in a box in the center this way it stays relatively accessible to the user even if they expand something.-->
<!-- Let the user save their searches? make the system modal? -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja">
<head>
	<link rel="shortcut icon" type="image/x-png" href="/favicon.ico" />
	<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
	<meta http-equiv="content-style-type" content="text/css" />

	<title>NAIST Language Tutor</title>
	<link rel="stylesheet" type="text/css" href="/stylesheets/style.css" />

	<%= javascript_include_tag :defaults %>
</head>

<body>

	<div id="heading">
		<h1>NAIST Language Tutor</h1>
		<h2>for students</h2>
	</div>
	<div width='400' id="inline_defs"></div>
	<div id="text_complexity"></div>
	<form>
		<div id="input">
			<%- if session[:input_text] != nil then -%>
				<%= text_area_tag "text", session[:input_text], :size => "40x10" %>
			<%- else -%>
				<%= text_area_tag "text", nil, :size => "40x10" %>
			<%- end -%>
		</div>
		<%= submit_to_remote nil, "lookup dictionary",:url => {:action=>:search} %>
	</form>
	<form id="parameters" >	
		<h3> <td><%= check_box :weight, :length,{},1.0,0.5 %></td>Sentence Length</h3>
		<table id="len_settings">
			<tr>
				<td>min:</td>
				<td><%= select :length, :min, [0,10,20,30] %></td>
				<td>words</td>
			</tr>
			<tr>
				<td>max:</td>
				<td><%= select :length, :max, [10,20,30,40],:selected =>30 %></td>
				<td>words</td>
			</tr>
		</table>
		
		<h3>Grade</h3>

		<table id="grade_settings">
		<%- view = ["Vocabulary","Kanji","Grammar","Frequency"] -%>
		<%- [:vocabulary,:kanji,:complexity,:corpus].each_with_index do |item,address| -%>
			<tr>
				<td><%= check_box :weight, item,{},1.0,0.5 %></td>
				<td><%= view[address] %> : </td>
				<td><%= select :grade, item, [1,2,3,4,"x"] %></td>
				<td>Rank</td>
			</tr>
		<%- end -%>
		</table>
		<%= check_box("adapted", "visible?",:checked => true) -%>hide example sentences
	
		<div id="result"></div>
	</form>

</body>
</html>